/**
 * @file compare.h
 * @author your name (you@domain.com)
 * @brief
 * @version 0.1
 * @date 2025-05-06
 *
 * @copyright Copyright (c) 2025
 *
 */
#ifndef COMPARE_H
#define COMPARE_H
#include <xmzTypeDefine.h>

// 定义比较操作类型
typedef enum {
    CMP_EQ, // 等于 (==)
    CMP_NE, // 不等于 (!=)
    CMP_GT, // 大于 (>)
    CMP_LT, // 小于 (<)
    CMP_GE, // 大于等于 (>=)
    CMP_LE  // 小于等于 (<=)
} CompareOp;

// 比较函数声明
Bool CompareByte(Bool pre, Byte val1, Byte val2, CompareOp op);
Bool CompareWord(Bool pre, Word val1, Word val2, CompareOp op);
Bool CompareDWord(Bool pre, DWord val1, DWord val2, CompareOp op);
Bool CompareLWord(Bool pre, LWord val1, LWord val2, CompareOp op);
Bool CompareSInt(Bool pre, SInt val1, SInt val2, CompareOp op);
Bool CompareUSInt(Bool pre, USInt val1, USInt val2, CompareOp op);
Bool CompareInt(Bool pre, Int val1, Int val2, CompareOp op);
Bool CompareUInt(Bool pre, UInt val1, UInt val2, CompareOp op);
Bool CompareDInt(Bool pre, DInt val1, DInt val2, CompareOp op);
Bool CompareUDInt(Bool pre, UDInt val1, UDInt val2, CompareOp op);
Bool CompareLInt(Bool pre, LInt val1, LInt val2, CompareOp op);
Bool CompareULInt(Bool pre, ULInt val1, ULInt val2, CompareOp op);
Bool CompareReal(Bool pre, Real val1, Real val2, CompareOp op);
Bool CompareLReal(Bool pre, LReal val1, LReal val2, CompareOp op);

// 范围比较函数声明
Bool InRangeByte(Bool pre, Byte value, Byte min, Byte max);
Bool OutOfRangeByte(Bool pre, Byte value, Byte min, Byte max);
Bool InRangeWord(Bool pre, Word value, Word min, Word max);
Bool OutOfRangeWord(Bool pre, Word value, Word min, Word max);
Bool InRangeDWord(Bool pre, DWord value, DWord min, DWord max);
Bool OutOfRangeDWord(Bool pre, DWord value, DWord min, DWord max);
Bool InRangeLWord(Bool pre, LWord value, LWord min, LWord max);
Bool OutOfRangeLWord(Bool pre, LWord value, LWord min, LWord max);
Bool InRangeSInt(Bool pre, SInt value, SInt min, SInt max);
Bool OutOfRangeSInt(Bool pre, SInt value, SInt min, SInt max);
Bool InRangeUSInt(Bool pre, USInt value, USInt min, USInt max);
Bool OutOfRangeUSInt(Bool pre, USInt value, USInt min, USInt max);
Bool InRangeInt(Bool pre, Int value, Int min, Int max);
Bool OutOfRangeInt(Bool pre, Int value, Int min, Int max);
Bool InRangeUInt(Bool pre, UInt value, UInt min, UInt max);
Bool OutOfRangeUInt(Bool pre, UInt value, UInt min, UInt max);
Bool InRangeDInt(Bool pre, DInt value, DInt min, DInt max);
Bool OutOfRangeDInt(Bool pre, DInt value, DInt min, DInt max);
Bool InRangeUDInt(Bool pre, UDInt value, UDInt min, UDInt max);
Bool OutOfRangeUDInt(Bool pre, UDInt value, UDInt min, UDInt max);
Bool InRangeLInt(Bool pre, LInt value, LInt min, LInt max);
Bool OutOfRangeLInt(Bool pre, LInt value, LInt min, LInt max);
Bool InRangeULInt(Bool pre, ULInt value, ULInt min, ULInt max);
Bool OutOfRangeULInt(Bool pre, ULInt value, ULInt min, ULInt max);
Bool InRangeReal(Bool pre, Real value, Real min, Real max);
Bool OutOfRangeReal(Bool pre, Real value, Real min, Real max);
Bool InRangeLReal(Bool pre, LReal value, LReal min, LReal max);
Bool OutOfRangeLReal(Bool pre, LReal value, LReal min, LReal max);

#endif // COMPARE_H
